﻿@* 
Project: Aguafrommars/TheIdServer
Copyright (c) 2022 @Olivier Lefebvre
*@
@page
@model RegisterModel
@{
    ViewData["Title"] = "Register";
}

<div class="login-page">
    <div class="page-header">
        <h1>@ViewData["Title"]</h1>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Create a new account</h3>
                </div>
                <div class="panel-body">
                    <form asp-route-returnUrl="@Model.ReturnUrl" method="post">
                        <div asp-validation-summary="All" class="text-danger"></div>
                        <div class="form-group">
                            <label asp-for="Input.Email"></label>
                            <input asp-for="Input.Email" class="form-control" />
                            <span asp-validation-for="Input.Email" class="text-danger"></span>
                        </div>
                        <div class="form-group">
                            <label asp-for="Input.Password"></label>
                            <input asp-for="Input.Password" class="form-control" />
                            <span asp-validation-for="Input.Password" class="text-danger"></span>
                        </div>
                        <div class="form-group">
                            <label asp-for="Input.ConfirmPassword"></label>
                            <input asp-for="Input.ConfirmPassword" class="form-control" />
                            <span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
                        </div>
                        <button type="submit" class="btn btn-default">Register</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-sm-6 external-providers">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Use another service to register</h3>
                </div>
                <div class="panel-body">
                    @if ((Model.ExternalLogins?.Count ?? 0) == 0)
                    {
                    <div>
                        <p>
                            There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
                            for details on setting up this ASP.NET application to support logging in via external services.
                        </p>
                    </div>
                    }
                    else
                    {
                    <form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
                        <div>
                            <p>
                                @foreach (var provider in Model.ExternalLogins)
                                    {
                                <button type="submit" class="btn btn-default" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
                                    }
                            </p>
                        </div>
                    </form>
                    }
                </div>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}
